<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8" />
    <title>轨迹回放</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <link rel="stylesheet" href="${ctxStatic}/gps/css/style.css" />
    <link rel="stylesheet" href="${ctxStatic}/gps/css/webchat_main.css" />
    <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>

    <script src="${ctxStatic}/gps/js/mobiscroll_002.js" type="text/javascript"></script>
    <script src="${ctxStatic}/gps/js/mobiscroll_004.js" type="text/javascript"></script>
    <link href="${ctxStatic}/gps/css/mobiscroll_002.css" rel="stylesheet" type="text/css">
    <link href="${ctxStatic}/gps/css/mobiscroll.css" rel="stylesheet" type="text/css">
    <script src="${ctxStatic}/gps/js/mobiscroll.js" type="text/javascript"></script>
    <script src="${ctxStatic}/gps/js/mobiscroll_003.js" type="text/javascript"></script>
    <script src="${ctxStatic}/gps/js/mobiscroll_005.js" type="text/javascript"></script>
    <link href="${ctxStatic}/gps/css/mobiscroll_003.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="select_time_wrap">
    <input type="hidden" value="7669174" id="terid" name="terid">
    <input type="hidden" value="01%E5%8F%B7%20%E4%B8%AD%E8%BD%B4%E7%BA%BF%20%E4%BA%ACAAV807" id="tername" name="tername">

    <h1 id="carname">${carInfo.name}&nbsp;&nbsp;${carInfo.carNum}</h1>

    <!--服务器选择
      <div class="time_way">
          <span class="select_zg" id="servertime" onclick="servertime();">服务器时间</span>
          <span onclick="gpstime();" id="gpstime">GPS时间</span>
      </div>
     -->
    <!--时间选择-->
    <div class="time_on">
        <i></i>
        <input type="text" value="" name="appDateTime" id="appDateTime" readonly="">

    </div>
    <!--时间选择 end-->

    <div class="time_button">
        <a href="javascript:void()" onclick="play();">开始回放</a>

    </div>
</div>
<!--服务器选择 end-->
<script type="text/javascript">
    document.addEventListener('WeixinJSBridgeReady', function onBridgeReady(){
        WeixinJSBridge.call('hideOptionMenu');
    });
    var datatype=1;
    $(function () {

        $("#carname").html(decodeURI($("#tername").val()))

        var currYear = (new Date()).getFullYear();
        var opt={};
        opt.date = {preset : 'date'};
        opt.datetime = {preset : 'datetime'};
        opt.time = {preset : 'time'};
        opt.default = {
            theme: 'android-ics light', //皮肤样式
            display: 'modal', //显示方式
            mode: 'scroller', //日期选择模式
            dateFormat: 'yyyy-mm-dd',
            lang: 'zh',
            showNow: false,
            startYear: currYear, //开始年份
            endYear: currYear + 10 //结束年份
        };



        $("#appDateTime").mobiscroll($.extend(opt['date'], opt['default']));

        loadTime();

    });

    function loadTime(){
        var MyDate = new Date();
        //获得昨天的日期
        var yesterday_miliseconds = MyDate.getTime() - 1000 * 60 * 60 * 24;
        var Yesterday = new Date();
        Yesterday.setTime(yesterday_miliseconds);

        var yesterday_year = Yesterday.getFullYear().toString();
        var month_temp = Yesterday.getMonth() + 1;
        var yesterday_month = month_temp > 9 ? month_temp.toString() : "0" + month_temp.toString();
        var d = Yesterday.getDate();
        var Day = d > 9 ? d.toString() : "0" + d.toString();

        $("#appDateTime").val(yesterday_year + "-" + yesterday_month + "-" + Day);


    }

    function play(){
        var tername = encodeURI($("#tername").val());
        window.location.href="${ctxFront}/gps/map2"+"?id=${carInfo.id}&sendTime="+$("#appDateTime").val();

    }
    function servertime(){
        $("#servertime").addClass("select_zg");
        $("#gpstime").removeClass("select_zg");
        datatype=1;

    }
    function gpstime(){
        $("#gpstime").addClass("select_zg");
        $("#servertime").removeClass("select_zg");
        datatype=0;
    }

</script>


<div id="J---TK-load" data-id="0001000520131018" data-guid="00000000C01C83DCB5A7D9CF57A1D9EA" data-source="360Jisu" data-browser="360chrome" data-version="2.1.8.3" data-message="1"></div><div id="TK-log"><img src="./轨迹回放_files/statistics.do" width="0" height="0" style="display: none;"></div>
</body>
</html>
